#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <erpc_client_setup.h>
#include <erpc_port.h>
#include "c_cifar10_client.h"

int main(int argc, char *argv[])
{
    erpc_transport_t transport = erpc_transport_tcp_init("127.0.0.1", 5555, false);
    erpc_mbf_t message_buffer_factory = erpc_mbf_dynamic_init();
    erpc_client_t client = erpc_client_init(transport, message_buffer_factory);
    initCifar10_client(client);

    binary_t img;
    img.dataLength = 32*32;
    img.data = (uint8_t*)malloc(32*32);

    // Call remote function
    double res = cifar10_recognize(32, 32, &img);
printf("===== Result =====\n");
    printf("%.5f\n", res);

    deinitCifar10_client();
    erpc_transport_tcp_close(transport);

    return 0;
}
